package com.xg.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xg.sys.dto.SysLogDto;
import com.xg.sys.dto.SysLogVo;
import com.xg.sys.entity.SysLog;
import com.xg.sys.mapper.SysLogMapper;
import com.xg.sys.service.SysLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
/**
 * <p>
 * 系统日志 服务实现类
 * </p>
 *
 
 * @since 2020-07-27
 */
@Service
public class SysLogServiceImpl extends ServiceImpl<SysLogMapper, SysLog> implements SysLogService {

    @Autowired
    private SysLogMapper sysLogMapper;
    @Override
    public void pageList(Page<SysLogVo> page, SysLogDto data) {
        QueryWrapper<SysLogVo> queryWrapper = new QueryWrapper<SysLogVo>();

        if (!StringUtils.isEmpty(data.getCreateUserName())){
//            queryWrapper.and();
        }
//        if (!StringUtils.isEmpty(data.getMethodsName())){
//            queryWrapper.setEntity(data);
//        }
//        queryWrapper.orderByDesc("create_time");
//        System.out.println("customSqlSegment="+queryWrapper.getCustomSqlSegment());
//        System.out.println("getSqlSegment="+queryWrapper.getSqlSegment());
//        queryWrapper.getCustomSqlSegment();
        //执行
        sysLogMapper.selectLogPage(page,data);
    }
}
